//============================================================================
// Name        : tptallerfinal.cpp
// Author      : 
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <fstream>
#include "Agente.h"
#include "Validador.h"
#include "Consulta.h"

int main() {
	std::cout << "!!!Hello World!!!" << std::endl; // prints !!!Hello World!!!
	std::fstream config("config_agente.txt");
	Agente a(config);
	std::ifstream inputf("__stdin__");
	std::vector<std::string> vs = a.comenzar(inputf);
	Validador v;
	v.cargarTablas("definicion_hechos.txt");
	std::vector<std::string>::iterator it;
	for(it = vs.begin(); it != vs.end(); ++it) {
		std::cout << *it;
	}
	v.validarRegistro(vs, 1);

	std::string s1("RECOLETA");
	std::string s2("JULIO");
	std::string s3("CAMPERA");

	Atributo_consulta* pendorcho = new Atributo_consulta(s1, D, 1);
	Atributo_consulta* cansopo = new Atributo_consulta(s2, D, 2);
	Atributo_consulta* falsofo = new Atributo_consulta(s3, D, 3);

	Consulta cons(1004, 1);
	cons.insertarAtributo(pendorcho); cons.insertarAtributo(cansopo); cons.insertarAtributo(falsofo);
	std::string y = cons.serializar();
	Consulta cons2;
	cons2.hidratar(y);
	v.validarConsulta(&cons2);


	return 0;
}
